﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace PreContractWeb.Report
{
    public partial class ScrollReport : System.Web.UI.UserControl
    {
        public bool EnableScroll
        {
            get
            {
                return ltlScrollScript.Visible;
            }
            set
            {
                ltlScrollScript.Visible = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region Property

        public string AreaWidth
        {
            get
            {
                return hfAreaWidth.Value.Trim();
            }

            set
            {
                hfAreaWidth.Value = value.Trim();
            }
        }

        public string AreaHeight
        {
            get
            {
                return hfAreaHeight.Value;
            }

            set
            {
                hfAreaHeight.Value = value.Trim();
            }
        }

        public string CornerWidth
        {
            get
            {
                return hfCornerWidth.Value;
            }

            set
            {
                hfCornerWidth.Value = value.Trim();
            }
        }

        public string CornerHeight
        {
            get
            {
                return hfCornerHeight.Value;
            }

            set
            {
                hfCornerHeight.Value = value.Trim();
            }
        }

        #endregion

        #region Report Data Property

        public string ContentHtml
        {
            get
            {
                return divReportContent.InnerHtml;
            }
            set
            {
                divReportContent.InnerHtml = value;
            }
        }

        public string HeaderHtml
        {
            get
            {
                return divReportHeader.InnerHtml;
            }
            set
            {
                divReportHeader.InnerHtml = value;
            }
        }

        public string CaptionHtml
        {
            get
            {
                return divReportCaption.InnerHtml;
            }
            set
            {
                divReportCaption.InnerHtml = value;
            }
        }

        public string CornerHtml
        {
            get
            {
                return divReportCorner.InnerHtml;
            }
            set
            {
                divReportCorner.InnerHtml = value;
            }
        }

        #endregion

        #region Public Function

        public void InitControl()
        {
            divReportArea.Style["width"] = this.AreaWidth;
            divReportArea.Style["height"] = this.AreaHeight;

            divReportCorner.Style["width"] = this.CornerWidth;
            divReportCorner.Style["height"] = this.CornerHeight;


            if (this.AreaWidth != "100%")
            {
                divReportContent.Style["width"] = this.AreaWidth;
            }

            if (this.AreaHeight != "100%")
            {
                divReportContent.Style["height"] = this.AreaHeight;
            }

        }


        #endregion
    }
}